package com.leyu.mall.site.sale.service.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.common.facade.ISaleRankListFacade;
import com.leyu.mall.site.sale.dao.SaleRankListMapper;
import com.leyu.mall.site.sale.domain.SaleRankList;
import com.leyu.mall.site.sale.service.ISaleRankListService;

@Service
@Transactional(rollbackFor = Exception.class)
public class SaleRankListServiceImpl implements ISaleRankListService,ISaleRankListFacade {

	@Resource(name = "saleRankListMapper")
	private SaleRankListMapper saleRankListMapper;

	public SaleRankList getSaleRankListById(Long entity_id) throws Exception {
		return saleRankListMapper.getSaleRankListById(entity_id);
	}

	public void save(SaleRankList entity) throws Exception {
		if (entity.getGoodsId() == null) {
			saleRankListMapper.addSaleRankList(entity);

		} else {

			saleRankListMapper.updateByPrimaryKey(entity);
		}
	}
	public void deleteSaleRankList(Long id) throws Exception {
		saleRankListMapper.deleteSaleRankList(id);
	}
	public List<SaleRankList> getAllSaleRankList() throws Exception {
		return saleRankListMapper.getAllSaleRankList();

	}
	
 
	
}